fix(mcp): make local-endpoint budgets configurable - #1856
Open
NullSense wants to merge 1 commit into
Open
Conversation
Ayush7614
approved these changes
Aug 22, 2026
Ayush7614
left a comment
Contributor
There was a problem hiding this comment.
Verified: pytest tests/unit/server/mcp/test_answer_synthesis_timeout.py tests/unit/server/mcp/test_embed_timeout.py -q 76 passed. Makes two hardcoded budgets configurable (REPOWISE_SYNTHESIS_MAX_TOKENS for reasoning models spending budget on hidden thinking, REPOWISE_EMBED_TIMEOUT_S via embed_timeout_s() mirroring vector_search_timeout_s()) with validate-and-warn fallback, correct 120s cap, and updated degraded message advertising the env var. Hotspot history (config.py 11.7 fixes) matches the bug-prone area being fixed — not a new risk. LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_answer/config.py:_SYNTHESIS_MAX_TOKENS(1024, hardcoded) now readsREPOWISE_SYNTHESIS_MAX_TOKENS. A reasoning model spends its whole budget on hidden thinking before emitting an answer token, so the call comes back empty at the old cap; measured against nanbeige, 1024 tokens returned nothing, 8192 produced a correct, cited answer._answer_pipeline.py/_helpers.py:_EMBED_TIMEOUT_S(8.0, hardcoded) now readsREPOWISE_EMBED_TIMEOUT_Svia a newembed_timeout_s(), mirroring the siblingvector_search_timeout_s(). A cold-loading local embedding model blows the old 8s budget;get_answerstill exits 0 with the semantic leg silently dropped, visible only at WARNING.REPOWISE_EMBEDDING_TIMEOUT/REPOWISE_VECTOR_SEARCH_TIMEOUT_S: an unparseable or non-positive override warns and keeps the default.Related Issues
None.
Test Plan
uv run pytest tests/unit/ -q— 14242 passed, 12 skipped, 2 xfailed. 2 failures, both pre-existing on unmodifiedmainand unrelated to this change: a git-rebase test that depends on local git config, and a timezone-sensitive episode-dating test.uv run ruff check .uv run repowise risk main..HEAD:config.pyalone shows a recency-weighted 11.7). That matches the PR's own premise — this is a bug-prone area — rather than indicating a new problem in this diff; the full-suite result above is the direct check on that.(
impacted-tests/health --fileneed a completedrepowise initagainst this clone; that indexing run did not finish in time and is omitted rather than faked.)Checklist
Written with AI assistance; measurements and tests were run and verified locally.